const sequelize = require("./db");
const { DataTypes } = require("sequelize");
//检查记录表
const Model = sequelize.define(
  "recordinfo",
  {
    id: {
      type: DataTypes.UUID,
      primaryKey: true,
      allowNull: false,
      defaultValue: DataTypes.UUIDV4,
    },
    sNo: {
      type: DataTypes.STRING,
      allowNull: false,
    },
    name: {
      type: DataTypes.STRING,
      allowNull: false,
    },
    sex: {
      type: DataTypes.INTEGER,
      allowNull: false,
    },
    birth: {
      type: DataTypes.STRING,
      allowNull: false,
    },
    year: {
      type: DataTypes.INTEGER,
    },
    tel: {
      type: DataTypes.STRING,
    },
    addr: {
      type: DataTypes.STRING,
    },
    pos: {
      type: DataTypes.STRING,
      allowNull: false,
    },
    height: {
      type: DataTypes.INTEGER,
    },
    weight: {
      type: DataTypes.INTEGER,
    },
    chief: {
      type: DataTypes.STRING,
    },
    his: {
      type: DataTypes.STRING,
    },
    date: {
      type: DataTypes.STRING,
      allowNull: false,
    },
    time: {
      type: DataTypes.BIGINT,
      allowNull: false,
    },
    images: {
      type: DataTypes.INTEGER,
    },
    movies: {
      type: DataTypes.INTEGER,
    },
    state: {
      type: DataTypes.INTEGER,
      allowNull: false,
    },
    seen: {
      type: DataTypes.TEXT,
    },
    tips: {
      type: DataTypes.TEXT,
    },
    seenData: {
      type: DataTypes.STRING,
      defaultValue: "[]",
    },
    reportimg: {
      type: DataTypes.TEXT("long"),
    },
    choseImg: {
      type: DataTypes.TEXT("long"),
    },
    videos: {
      type: DataTypes.TEXT("long"),
    },
    doctor_sn: {
      type: DataTypes.STRING,
    },
    patient_sn: {
      type: DataTypes.STRING,
    },
    hospitalInfo: {
      type: DataTypes.TEXT("long"),
    },
    doc_hospital: {
      type: DataTypes.STRING,
    },
    pat_hospital: {
      type: DataTypes.STRING,
    },
    doc_sign: {
      type: DataTypes.TEXT("long"),
    },
    pat_sign: {
      type: DataTypes.TEXT("long"),
    },
    model: {
      type: DataTypes.STRING,
    },
    pat_alias: {
      type: DataTypes.STRING,
    },
    measureInfo: {
      type: DataTypes.TEXT("long"),
    },
    // realModel:{
    //   type: DataTypes.STRING,
    // }
  },
  {
    // paranoid: true,
    freezeTableName: true,
  }
);
module.exports = Model;

// stateInfo: {
//   0: "等待检查",
//   1: "正在检查",
//   2: "暂停检查",
//   3: "结束检查",
//   4: "已出报告",
//   5: "检查中断",
// },
